Add Swift Native Version Range Support and Associated Unit Tests - #155
Closed
PlayerIUnknown wants to merge 1 commit into
Closed
Add Swift Native Version Range Support and Associated Unit Tests#155PlayerIUnknown wants to merge 1 commit into
PlayerIUnknown wants to merge 1 commit into
Conversation
Signed-off-by: PlayerIUnknown <playerunknownasap@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces support for Swift's native version ranges within the Univers project. Swift utilizes semantic versioning, and this update enables the handling of Swift package manager's specific version range declarations effectively. The update includes parsing logic for Swift version ranges and corresponding unit tests to ensure functionality adheres to Swift's versioning specifications.
Details
Swift's package manager allows specifying dependencies with various version range formats. This implementation supports the following native Swift version range specifications:
exact: "X.Y.Z", where the dependency must match an exact version.from: "X.Y.Z", indicating a minimum version up to the next major version but not including."X.Y.Z"..<"A.B.C"to specify a range including the lower bound but excluding the upper bound."X.Y.Z"..."A.B.C"to specify a range including both the lower and upper bounds.Changes Made
tests/test_swift_versions.pyto verify parsing and handling of all supported version range specifications.Example Usage
The
SwiftVersionRangecan be instantiated with a Swift version range string:This will parse and prepare constraints that ensure compatibility checks against provided Swift package versions.
Testing
Unit tests cover:
Impact
This update allows developers using the Univers project to integrate Swift packages more seamlessly, adhering to Swift's native versioning schemes. It enhances the versatility of the Univers version range handling and ensures better cross-platform package management compatibility.